package com.mew.chess.core.common.utils;

import cn.hutool.core.util.RandomUtil;
import com.mew.common.util.DateUtils;

import java.util.Date;

public class RobotNumberUtils {

    //机器人浮动小时分区
    public static int[] hours = {3,5,7,9,11,13,15,17,19,21,23,25};

    //机器人浮动量
    public static int[] floats = {110,140,160,140,130,130,130,150,130,110,0,110};


    public static int robotNumber(int num){

        int hh = Integer.parseInt(DateUtils.format(new Date(), "HH"));

        for (int i = 0; i < hours.length; i++) {
            if (hh<hours[i]){
                return num*floats[i]* RandomUtil.randomInt(80,120)/10000;
            }
        }

        return num;
    }

}
